package com.ruoyi.project.platform.service.impl;

import java.util.List;

import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.platform.mapper.RRunningExchangeMapper;
import com.ruoyi.project.platform.domain.RRunningExchange;
import com.ruoyi.project.platform.service.IRRunningExchangeService;

/**
 * 运行机器人币对Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-07-30
 */
@Service
public class RRunningExchangeServiceImpl implements IRRunningExchangeService 
{
    @Autowired
    private RRunningExchangeMapper rRunningExchangeMapper;

    /**
     * 查询运行机器人币对
     * 
     * @param runningId 运行机器人币对ID
     * @return 运行机器人币对
     */
    @Override
    public RRunningExchange selectRRunningExchangeById(Long runningId)
    {
        return rRunningExchangeMapper.selectRRunningExchangeById(runningId);
    }

    /**
     * 查询运行机器人币对列表
     * 
     * @param rRunningExchange 运行机器人币对
     * @return 运行机器人币对
     */
    @Override
    public List<RRunningExchange> selectRRunningExchangeList(RRunningExchange rRunningExchange)
    {
        List<RRunningExchange> result= rRunningExchangeMapper.selectRRunningExchangeList(rRunningExchange);
        return  result;
    }

    /**
     * 新增运行机器人币对
     * 
     * @param rRunningExchange 运行机器人币对
     * @return 结果
     */
    @Override
    public int insertRRunningExchange(RRunningExchange rRunningExchange)
    {
        int size= rRunningExchangeMapper.selectRRunningExchangeList(rRunningExchange).size();
        rRunningExchange.setSequence(size+1);
        return rRunningExchangeMapper.insertRRunningExchange(rRunningExchange);
    }

    /**
     * 修改运行机器人币对
     * 
     * @param rRunningExchange 运行机器人币对
     * @return 结果
     */
    @Override
    public int updateRRunningExchange(RRunningExchange rRunningExchange)
    {
        return rRunningExchangeMapper.updateRRunningExchange(rRunningExchange);
    }

    /**
     * 批量删除运行机器人币对
     * 
     * @param runningIds 需要删除的运行机器人币对ID
     * @return 结果
     */
    @Override
    public int deleteRRunningExchangeByIds(Long[] runningIds)
    {
        return rRunningExchangeMapper.deleteRRunningExchangeByIds(runningIds);
    }

    /**
     * 删除运行机器人币对信息
     * 
     * @param runningId 运行机器人币对ID
     * @return 结果
     */
    @Override
    public int deleteRRunningExchangeById(Long runningId)
    {
        return rRunningExchangeMapper.deleteRRunningExchangeById(runningId);
    }
}
